-- GENERATED SPELL FOR [Xandivious] --


function spell0_15623(pUnit, Event) --@Blast Wave,Self--
pUnit:FullCastSpellOnTarget(16046,pUnit)
pUnit:RegisterEvent('Sorts_15623', 6283, 1)
end

function spell1_15623(pUnit, Event) --@Curse of Weakness,n/a--
pUnit:FullCastSpellOnTarget(11980,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15623', 601, 1)
end

function spell2_15623(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_15623', 601, 1)
end

function spell3_15623(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(11639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15623', 18000, 1)
end

function spell4_15623(pUnit, Event) --@Xandivious Demon Bag,n/a--
pUnit:FullCastSpellOnTarget(25791,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15623', 643, 1)
end

function Sorts_15623(pUnit, Event)
local choix_sorts_15623 = math.random(0, 4)
if choix_sorts_15623 == 0 then
pUnit:RegisterEvent('spell0_15623', 1, 1)
end
if choix_sorts_15623 == 1 then
pUnit:RegisterEvent('spell1_15623', 1, 1)
end
if choix_sorts_15623 == 2 then
pUnit:RegisterEvent('spell2_15623', 1, 1)
end
if choix_sorts_15623 == 3 then
pUnit:RegisterEvent('spell3_15623', 1, 1)
end
if choix_sorts_15623 == 4 then
pUnit:RegisterEvent('spell4_15623', 1, 1)
end
end

function mob15623_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15623', math.random(1500, 3000), 1)
end

function mob15623_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15623_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15623_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15623, 1, 'mob15623_Action')
RegisterUnitEvent(15623, 2, 'mob15623_Leave')
RegisterUnitEvent(15623, 3, 'mob15623_Kill')
RegisterUnitEvent(15623, 4, 'mob15623_Die')
